home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / mac / files / t_sys5 / 92052tar.gz / 920528.tar / netuser.h < prev    next >
C/C++ Source or Header  |  1992-05-28  |  2KB  |  68 lines

  1. /* @(#) $Header: netuser.h,v 1.8 92/05/28 13:50:26 deyke Exp $ */
  2.  
  3. #ifndef _NETUSER_H
  4. #define _NETUSER_H
  5.  
  6. /* Global structures and constants needed by an Internet user process */
  7.  
  8. #ifndef _GLOBAL_H
  9. #include "global.h"
  10. #endif
  11.  
  12. #define NCONN   20              /* Maximum number of open network connections */
  13.  
  14. extern int32 Ip_addr;   /* Our IP address */
  15. extern int Net_error;   /* Error return code */
  16. extern char Inet_eol[];
  17.  
  18. #define NONE            0       /* No error */
  19. #define CON_EXISTS      1       /* Connection already exists */
  20. #define NO_CONN         2       /* Connection does not exist */
  21. #define CON_CLOS        3       /* Connection closing */
  22. #define NO_MEM          4       /* No memory for TCB creation */
  23. #define WOULDBLK        5       /* Would block */
  24. #define NOPROTO         6       /* Protocol or mode not supported */
  25. #define INVALID         7       /* Invalid arguments */
  26.  
  27. /* Codes for the tcp_open call */
  28. #define TCP_PASSIVE     0
  29. #define TCP_ACTIVE      1
  30. #define TCP_SERVER      2       /* Passive, clone on opening */
  31.  
  32. /* Local IP wildcard address */
  33. #ifndef INADDR_ANY
  34. #define INADDR_ANY      0x0L
  35. #endif
  36.  
  37. /* Socket structure */
  38. struct socket {
  39.     int32 address;          /* IP address */
  40.     int16 port;             /* port number */
  41. };
  42. #define NULLSOCK        (struct socket *)0
  43.  
  44. /* Connection structure (two sockets) */
  45. struct connection {
  46.     struct socket local;
  47.     struct socket remote;
  48. };
  49. /* In domain.c: */
  50. int32 resolve __ARGS((char *name));
  51. int32 resolve_mx __ARGS((char *name));
  52. char *resolve_a __ARGS((int32 ip_address, int shorten));
  53.  
  54. /* In netuser.c: */
  55. int32 aton __ARGS((char *s));
  56. char *inet_ntoa __ARGS((int32 a));
  57. char *pinet __ARGS((struct socket *s));
  58.  
  59. /* In services.c: */
  60. char *tcp_port_name __ARGS((int port));
  61. char *udp_port_name __ARGS((int port));
  62. int tcp_port_number __ARGS((char *name));
  63. int udp_port_number __ARGS((char *name));
  64. char *pinet_tcp __ARGS((struct socket *s));
  65. char *pinet_udp __ARGS((struct socket *s));
  66.  
  67. #endif  /* _NETUSER_H */
  68.